package com.study.design.pattern.principle.openclone;

import java.math.BigDecimal;

/**
 * @Author: gongsl
 * @Date: 2025-01-11 15:19
 * @description:
 */
public class JavaDiscountCourse extends JavaCourse {
    public JavaDiscountCourse(Integer id, String name, BigDecimal price) {
        super(id, name, price);
    }

    /**
     * 课程原价
     */
    public BigDecimal getOriginPrice() {
        return super.getPrice();
    }

    /**
     * 课程打折价格(八折)
     */
    @Override
    public BigDecimal getPrice() {
        return super.getPrice().multiply(new BigDecimal("0.8"));
    }
}
